Optimal. Leaf size=163 \[ \frac {a^3 (15 B+13 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^3 (15 B+13 C) \tan (c+d x)}{5 d}+\frac {3 a^3 (15 B+13 C) \sec (c+d x) \tan (c+d x)}{40 d}+\frac {(5 B-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{20 d}+\frac {C (a+a \sec (c+d x))^4 \tan (c+d x)}{5 a d}+\frac {a^3 (15 B+13 C) \tan ^3(c+d x)}{60 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 163, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 8, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {4157, 4095,
4086, 3876, 3855, 3852, 8, 3853} \begin {gather*} \frac {a^3 (15 B+13 C) \tan ^3(c+d x)}{60 d}+\frac {a^3 (15 B+13 C) \tan (c+d x)}{5 d}+\frac {a^3 (15 B+13 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {3 a^3 (15 B+13 C) \tan (c+d x) \sec (c+d x)}{40 d}+\frac {(5 B-C) \tan (c+d x) (a \sec (c+d x)+a)^3}{20 d}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^4}{5 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3853
Rule 3855
Rule 3876
Rule 4086
Rule 4095
Rule 4157
Rubi steps
\begin {align*} \int \sec (c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \sec ^2(c+d x) (a+a \sec (c+d x))^3 (B+C \sec (c+d x)) \, dx\\ &=\frac {C (a+a \sec (c+d x))^4 \tan (c+d x)}{5 a d}+\frac {\int \sec (c+d x) (a+a \sec (c+d x))^3 (4 a C+a (5 B-C) \sec (c+d x)) \, dx}{5 a}\\ &=\frac {(5 B-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{20 d}+\frac {C (a+a \sec (c+d x))^4 \tan (c+d x)}{5 a d}+\frac {1}{20} (15 B+13 C) \int \sec (c+d x) (a+a \sec (c+d x))^3 \, dx\\ &=\frac {(5 B-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{20 d}+\frac {C (a+a \sec (c+d x))^4 \tan (c+d x)}{5 a d}+\frac {1}{20} (15 B+13 C) \int \left (a^3 \sec (c+d x)+3 a^3 \sec ^2(c+d x)+3 a^3 \sec ^3(c+d x)+a^3 \sec ^4(c+d x)\right ) \, dx\\ &=\frac {(5 B-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{20 d}+\frac {C (a+a \sec (c+d x))^4 \tan (c+d x)}{5 a d}+\frac {1}{20} \left (a^3 (15 B+13 C)\right ) \int \sec (c+d x) \, dx+\frac {1}{20} \left (a^3 (15 B+13 C)\right ) \int \sec ^4(c+d x) \, dx+\frac {1}{20} \left (3 a^3 (15 B+13 C)\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{20} \left (3 a^3 (15 B+13 C)\right ) \int \sec ^3(c+d x) \, dx\\ &=\frac {a^3 (15 B+13 C) \tanh ^{-1}(\sin (c+d x))}{20 d}+\frac {3 a^3 (15 B+13 C) \sec (c+d x) \tan (c+d x)}{40 d}+\frac {(5 B-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{20 d}+\frac {C (a+a \sec (c+d x))^4 \tan (c+d x)}{5 a d}+\frac {1}{40} \left (3 a^3 (15 B+13 C)\right ) \int \sec (c+d x) \, dx-\frac {\left (a^3 (15 B+13 C)\right ) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{20 d}-\frac {\left (3 a^3 (15 B+13 C)\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{20 d}\\ &=\frac {a^3 (15 B+13 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^3 (15 B+13 C) \tan (c+d x)}{5 d}+\frac {3 a^3 (15 B+13 C) \sec (c+d x) \tan (c+d x)}{40 d}+\frac {(5 B-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{20 d}+\frac {C (a+a \sec (c+d x))^4 \tan (c+d x)}{5 a d}+\frac {a^3 (15 B+13 C) \tan ^3(c+d x)}{60 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(391\) vs. \(2(163)=326\).
time = 0.85, size = 391, normalized size = 2.40 \begin {gather*} -\frac {a^3 \sec ^5(c+d x) \left (225 B \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+195 C \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+150 (15 B+13 C) \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+75 (15 B+13 C) \cos (3 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-225 B \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-195 C \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-1200 B \sin (c+d x)-1600 C \sin (c+d x)-1140 B \sin (2 (c+d x))-1500 C \sin (2 (c+d x))-1560 B \sin (3 (c+d x))-1520 C \sin (3 (c+d x))-450 B \sin (4 (c+d x))-390 C \sin (4 (c+d x))-360 B \sin (5 (c+d x))-304 C \sin (5 (c+d x))\right )}{1920 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.39, size = 271, normalized size = 1.66
method | result | size |
norman | \(\frac {-\frac {32 a^{3} \left (15 B +13 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}+\frac {7 a^{3} \left (15 B +13 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}-\frac {a^{3} \left (15 B +13 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {a^{3} \left (49 B +51 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {a^{3} \left (183 B +133 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5}}-\frac {a^{3} \left (15 B +13 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {a^{3} \left (15 B +13 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(201\) |
derivativedivides | \(\frac {a^{3} B \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-a^{3} C \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )-3 a^{3} B \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+3 a^{3} C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+3 a^{3} B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-3 a^{3} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+a^{3} B \tan \left (d x +c \right )+a^{3} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(271\) |
default | \(\frac {a^{3} B \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-a^{3} C \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )-3 a^{3} B \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+3 a^{3} C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+3 a^{3} B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-3 a^{3} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+a^{3} B \tan \left (d x +c \right )+a^{3} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(271\) |
risch | \(-\frac {i a^{3} \left (225 B \,{\mathrm e}^{9 i \left (d x +c \right )}+195 C \,{\mathrm e}^{9 i \left (d x +c \right )}-120 B \,{\mathrm e}^{8 i \left (d x +c \right )}+570 B \,{\mathrm e}^{7 i \left (d x +c \right )}+750 C \,{\mathrm e}^{7 i \left (d x +c \right )}-1200 B \,{\mathrm e}^{6 i \left (d x +c \right )}-720 C \,{\mathrm e}^{6 i \left (d x +c \right )}-2400 B \,{\mathrm e}^{4 i \left (d x +c \right )}-2320 C \,{\mathrm e}^{4 i \left (d x +c \right )}-570 B \,{\mathrm e}^{3 i \left (d x +c \right )}-750 C \,{\mathrm e}^{3 i \left (d x +c \right )}-1680 B \,{\mathrm e}^{2 i \left (d x +c \right )}-1520 C \,{\mathrm e}^{2 i \left (d x +c \right )}-225 B \,{\mathrm e}^{i \left (d x +c \right )}-195 C \,{\mathrm e}^{i \left (d x +c \right )}-360 B -304 C \right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}-\frac {15 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{8 d}-\frac {13 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{8 d}+\frac {15 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{8 d}+\frac {13 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{8 d}\) | \(299\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 337 vs.
\(2 (151) = 302\).
time = 0.27, size = 337, normalized size = 2.07 \begin {gather*} \frac {240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{3} + 16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} C a^{3} + 240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{3} - 15 \, B a^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 45 \, C a^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 180 \, B a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, C a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 240 \, B a^{3} \tan \left (d x + c\right )}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.12, size = 165, normalized size = 1.01 \begin {gather*} \frac {15 \, {\left (15 \, B + 13 \, C\right )} a^{3} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (15 \, B + 13 \, C\right )} a^{3} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (45 \, B + 38 \, C\right )} a^{3} \cos \left (d x + c\right )^{4} + 15 \, {\left (15 \, B + 13 \, C\right )} a^{3} \cos \left (d x + c\right )^{3} + 8 \, {\left (15 \, B + 19 \, C\right )} a^{3} \cos \left (d x + c\right )^{2} + 30 \, {\left (B + 3 \, C\right )} a^{3} \cos \left (d x + c\right ) + 24 \, C a^{3}\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int B \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 B \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 B \sec ^{4}{\left (c + d x \right )}\, dx + \int B \sec ^{5}{\left (c + d x \right )}\, dx + \int C \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 C \sec ^{4}{\left (c + d x \right )}\, dx + \int 3 C \sec ^{5}{\left (c + d x \right )}\, dx + \int C \sec ^{6}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.52, size = 246, normalized size = 1.51 \begin {gather*} \frac {15 \, {\left (15 \, B a^{3} + 13 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (15 \, B a^{3} + 13 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (225 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 195 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 1050 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 910 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 1920 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 1664 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 1830 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 1330 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 735 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 765 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.52, size = 224, normalized size = 1.37 \begin {gather*} \frac {a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (15\,B+13\,C\right )}{4\,d}-\frac {\left (\frac {15\,B\,a^3}{4}+\frac {13\,C\,a^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (-\frac {35\,B\,a^3}{2}-\frac {91\,C\,a^3}{6}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (32\,B\,a^3+\frac {416\,C\,a^3}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {61\,B\,a^3}{2}-\frac {133\,C\,a^3}{6}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {49\,B\,a^3}{4}+\frac {51\,C\,a^3}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________